/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package firma;

import java.util.Iterator;
import java.util.List;
import model.Firma;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *
 * @author tomasz
 */
@Controller
@RequestMapping("/firma.htm")
public class FirmaList {
    
    
    private dao.Firma firma;
    
    @Autowired
    public void setFirma(dao.Firma firma){
        this.firma = firma;
    }
    
    @RequestMapping(method = RequestMethod.GET)
    public String CreateInvitation(Model model) {
        
        
        List firms = this.firma.allFirma();
        model.addAttribute("firms", firms);
        
        return "firma/firma_list";
        
    }
    
}
